<link rel="stylesheet" href="%{$site_url}css/jquery/jquery.comboselect.css" type="text/css" />
<script type="text/javascript"	src="%{$site_url}js/lib/jquery/jquery.selso.js"></script>
<script type="text/javascript"	src="%{$site_url}js/lib/jquery/jquery.comboselect.js"></script>

<script type="text/javascript">
	$(document).ready(function() {
		$('#available_roles').comboselect({ sort: 'both', addbtn: '+',  rembtn: '-' });
	});
</script>


<div class="content_box_large">
%{if $context->isUserLoggedIn()}
	<p><b class="green">User panel</b></p>
	<br/>
	<br/>
	
	<form action="" method="POST" name="panelForm" id="panelForm">
		<fieldset>
			<legend>%{trn key="user_account_info"}</legend>
			<input type="hidden" name="user[id]" value="%{$user->getId()}" />
			<br/>
			<label for="panelForm_email" class="large">%{trn key="user_email"}:</label>
			<input type="text" name="user[email]" id="panelForm_email" value="%{$user->getEmail()}" readonly="readonly" class="large"/>
			<br/>
			<label for="panelForm_name" class="large">%{trn key="user_name"}:</label>
			<input type="text" name="user[name]" id="panelForm_name" value="%{$user->getName()}" class="large"/>
			<br/>
			<label for="panelForm_phone" class="large">%{trn key="user_phone"}:</label>
			<input type="text" name="user[phone]" id="panelForm_phone" value="%{$user->getPhone()}" class="large"/>
			<br/>
			%{if $user->getActive() eq 1}
				%{assign var=status value="checked='checked'"}
			%{else}
				%{assign var=status value=""}
			%{/if}
			<label for="panelForm_active" class="large">%{trn key="user_active"}:</label>
			<input type="hidden" name="user[active]" value="0"/>	
			<input type="checkbox" name="user[active]" id="panelForm_active" %{$status} value="1" />
			<br/><br/>

			<label for="available_roles" class="large">Available roles:</label>
			<select id="available_roles" name="roles[]" multiple="multiple" size="4">
				%{foreach from=$availableRoles item=role name=roleIterator}
					<option value="%{$role->getId()}" %{if $role->getName()|in_array:$roles}selected="selected"%{/if}>
						%{$role->getName()}
					</option>
				%{/foreach}	
			</select>
					
			<br/><br/>
			<input type="submit" name="method:save" id="panelForm_submit" value="%{trn key="button_submit"}"/>
			&nbsp;
			<input type="button" name="cancel" id="panelForm_cancel" value="%{trn key="button_cancel"}" onclick="history.go(-1);"/>
		</fieldset>
	</form>	

%{/if}
</div> 
